public class Test {
    //​
    // 有效括号序列
    //
    //​
    /*
        public boolean isValid (String s) {
        int len = s.length();
        //单数直接false 或者第一个字符为右半半部分
        char ss = s.charAt(0);
        if(len %2 == 1 || ss == ')' || ss == ']' || ss == '}' ) {
            return false;
        }
        Stack<Character> s1 = new Stack<>();
        for(int i = 0;i < len ; i++) {
            char ch = s.charAt(i);
            if(ch == '(' || ch == '[' || ch == '{') {
                s1.push(ch);
            } else {
                //拿出栈顶元素
                char ch1 = s1.peek();
                if(ch == ')' && ch1 == '('
                || ch == ']' && ch1 == '['
                || ch == '}' && ch1 == '{') {
                    s1.pop();
                } else {
                    return false;
                }
            }
        }
        return s1.isEmpty();
    }
     */

    /*
    滑动窗口的最大值
        public ArrayList<Integer> maxInWindows (int[] num, int size) {
        // write code here
         ArrayList<Integer> ret = new ArrayList<>();
        if(num.length < size || size == 0) {
            return ret;
        }

        int left = 0 , right = size-1;
        while(right < num.length) {
            ret.add(getMax(num,left,right));
            left++;
            right++;
        }
        return ret;
    }
    public int getMax(int[] nums,int left,int right) {
        int max = 0;
        for(int i = left;i<=right;i++) {
            if(max <= nums[i]) {
                max = nums[i];
            }
        }
        return max;
    }
     */

}
